﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class SelectFlag : MonoBehaviour
{
    public Vector2[] selectFlagPosition = new Vector2[]
   {
        new Vector2(-84f,-44f),
        new Vector2(-84f,-44f-16f),
   };

    private bool selectPress, startPress, twoPlayers;

    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {
        startPress = Input.GetButtonDown("Start");
    }

    private void FixedUpdate()
    {
        selectPress = Input.GetButtonDown("Select");
        //UpdateSelect();
    }
    private void UpdateSelect()
    {
        if (selectPress)
        {
            twoPlayers = !twoPlayers;
        }
        Vector2 flagPosition = selectFlagPosition[twoPlayers ? 1 : 0];
        if (TryGetComponent(out RectTransform rt))
        {
            rt.anchoredPosition = flagPosition;
        }
    }
}
